package com.yuyou.activity.comm.service.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.activity.comm.service.entity.PayRefund;
import com.yuyou.activity.comm.service.mapper.PayRefundMapper;
import com.yuyou.activity.comm.service.service.IPayRefundService;
import com.yuyou.activity.util.bean.ResBoolSimpleInfo;
import com.yuyou.activity.util.util.Sequence;

@Service
public class PayRefundServiceImpl implements IPayRefundService {

	@Autowired
	private PayRefundMapper payRefundMapper;
	
	@Override
	public int deleteByPrimaryKey(Long payRefundId) {
		return payRefundMapper.deleteByPrimaryKey(payRefundId);
	}

	@Override
	public int insert(PayRefund record) {		
		record.setPayRefundId(Sequence.getSequence().nextId());
		record.setCreateTime(new Date());
		return payRefundMapper.insert(record);
	}

	@Override
	public PayRefund selectByPrimaryKey(Long payRefundId) {
		return payRefundMapper.selectByPrimaryKey(payRefundId);
	}

	@Override
	public int updateByPrimaryKeySelective(PayRefund record) {
		return payRefundMapper.updateByPrimaryKeySelective(record);
	}
	
	@Override
	public PayRefund selectByOrderId(String orderId) {
		return payRefundMapper.selectByOrderId(orderId);
	}

	@Override
	public ResBoolSimpleInfo<String> add(PayRefund record) {
		this.insert(record);
		return ResBoolSimpleInfo.getSuccessInfo();
	}

	@Override
	public PayRefund selectByRefundId(String refundId) {
		return payRefundMapper.selectByRefundId(refundId);
	}

	

}